﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace ProjectEuler
{
    internal class Problem1
    {
        readonly List<int> _numbers = new List<int>();

        public void Solve()
        {
            for (int i = 0; i < 1000; i++)
            {
                if (IsMultOf(i, 3) || IsMultOf(i, 5))
                    _numbers.Add(i);
            }

            var sum = _numbers.Sum();
            Console.WriteLine("sum is " + sum);
        }

        static bool IsMultOf(int number, int mult)
        {
            decimal div = (decimal)number / (decimal)mult;
            var integral = div - Math.Floor(div);
            return integral == 0;
        }
    }
}